<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <ul id="ul"></ul>
    <script>
      let ul = document.getElementById("ul");
      let arr = [
        { name: "小明", age: 12, hobby: "篮球" },
        { name: "小红", age: 11, hobby: "花花" },
        { name: "小花", age: 12, hobby: "骑单车" },
      ];
      for (let item of arr) {
        ul.innerHTML += [
          "<li>",
          '    <div class="person">' + item.name + "的基本信息</div>",
          '    <div class="info">',
          "        <p>姓名：" + item.name + "</p>",
          "        <p>年龄：" + item.age + "</p>",
          "        <p>爱好：" + item.hobby + "</p>",
          "    </div>",
          "</li>",
        ].join("");
      }
    </script>
  </body>
</html>
